<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <title>SIF Implementation Specification 2.2 - Selective Message Blocking (SMB) Example</title>
    <link rel="stylesheet" type="text/css" href="include/document.css" />
    <link rel="stylesheet" type="text/css" href="include/specification.css" />
  </head>
  <body>
    <div class="navigation" id="topnavigation">
      <a href="index.html">home</a>
      <a href="WildcardVersionSupportImplementationNotes.html">previous</a>
      <a href="BackgroundSupplementaryDocumentationNonNormative.html">next</a>
      <a href="index.html#contents">table of contents</a>
      <hr />
    </div>
    <a name="SelectiveMessageBlockingSMBExample" />
    <h1>Appendix F: Selective Message Blocking (SMB) Example</h1>
    <a name="Example" />
    <h2>F.1 Example</h2>
    <p>A detailed example of Selective Message Blocking (SMB) follows. The table below represents the agent's message queue as maintained by the ZIS. 
						The message at the top represents the oldest message in the queue and is the message that is currently being processed
by the agent as the example begins.</p>
    <a name="TableF11AgentMessageQueueExample1" />
    <table title="Agent Message Queue - Example 1">
      <thead>
        <tr>
          <td>Agent Message Queue</td>
        </tr>
      </thead>
      <tr>
        <td>
          <code>SIF_Event</code> message containing a <code>StudentSchoolEnrollment</code> object with an <code>Action</code> of <code>Add</code>.</td>
      </tr>
      <tr>
        <td>
          <code>SIF_Event</code> message containing a <code>StudentPersonal</code> object with an <code>Action</code> of <code>Add</code>.</td>
      </tr>
      <tr>
        <td>
          <code>SIF_Request</code> message for a <code>StudentPersonal</code> object from another agent.</td>
      </tr>
      <tr>
        <td>
          <code>SIF_Event</code> message containing a <code>StudentSchoolEnrollment</code> object with an <code>Action</code> of <code>Add</code>.</td>
      </tr>
    </table>
    <span class="caption">Table F.1-1: Agent Message Queue - Example 1</span>
    <p>When processing the <code>StudentSchoolEnrollment</code> event, the agent requires data from a <code>SchoolInfo</code> object that it doesn't have locally. 
						It would like to request the <code>SchoolInfo</code> object without needing to process subsequent events.  To do so, the agent acknowledges
						the <code>StudentSchoolEnrollment</code> event with an "Intermediate" 
						<code>SIF_Ack</code> indicating that the ZIS will be contacted later to resume delivery of events.  It then opens a channel to the ZIS and
						submits a <code>SIF_Request</code> for the <code>SchoolInfo</code> object.</p>
    <p>Upon receipt of the "Intermediate" <code>SIF_Ack</code>, the ZIS freezes the delivery of any <code>SIF_Event</code> messages to this agent 
						until the agent sends a final <code>SIF_Ack</code> releasing the original event.  The current state of the queue is now:</p>
    <a name="TableF12AgentMessageQueueExample2" />
    <table title="Agent Message Queue - Example 2">
      <thead>
        <tr>
          <td>Agent Message Queue</td>
        </tr>
      </thead>
      <tr>
        <td>
          <code>SIF_Event</code> message containing a <code>StudentSchoolEnrollment</code> object with an <code>Action</code> of <code>Add</code>. (blocked)</td>
      </tr>
      <tr>
        <td>
          <code>SIF_Event</code> message containing a <code>StudentPersonal</code> object with an <code>Action</code> of <code>Add</code>. (frozen)</td>
      </tr>
      <tr>
        <td>
          <code>SIF_Request</code> message for a <code>StudentPersonal</code> object from another agent.</td>
      </tr>
      <tr>
        <td>
          <code>SIF_Event</code> message containing a <code>StudentSchoolEnrollment</code> object with an <code>Action</code> of <code>Add</code>. (frozen)</td>
      </tr>
    </table>
    <span class="caption">Table F.1-2: Agent Message Queue - Example 2</span>
    <p>The next message available for delivery to the agent is the <code>SIF_Request</code> for a <code>StudentPersonal</code> object. 
						For our example, the agent will accept the <code>SIF_Request</code> by returning an "Immediate" <code>SIF_Ack</code> 
						indicating that processing is complete and the agent will hand the <code>SIF_Request</code> off to another part of the agent for handling.</p>
    <p>Meanwhile, the ZIS has deposited the <code>SIF_Response</code> from the <code>SchoolInfo</code> provider's agent into the queue. The queue now looks like this:</p>
    <a name="TableF13AgentMessageQueueExample3" />
    <table title="Agent Message Queue - Example 3">
      <thead>
        <tr>
          <td>Agent Message Queue</td>
        </tr>
      </thead>
      <tr>
        <td>
          <code>SIF_Event</code> message containing a <code>StudentSchoolEnrollment</code> object with an <code>Action</code> of <code>Add</code>. (blocked)</td>
      </tr>
      <tr>
        <td>
          <code>SIF_Event</code> message containing a <code>StudentPersonal</code> object with an <code>Action</code> of <code>Add</code>. (frozen)</td>
      </tr>
      <tr>
        <td>
          <code>SIF_Event</code> message containing a <code>StudentSchoolEnrollment</code> object with an <code>Action</code> of <code>Add</code>. (frozen)</td>
      </tr>
      <tr>
        <td>
          <code>SIF_Response</code> message containing the <code>SchoolInfo</code> object previously requested.</td>
      </tr>
    </table>
    <span class="caption">Table F.1-3: Agent Message Queue - Example 3</span>
    <p>The next message the agent receives is the <code>SIF_Response</code>. The agent takes the <code>SIF_Response</code> and uses the information from it 
						along with the data in the original <code>StudentSchoolEnrollment</code> event to update its database.  The agent returns (Pull-Mode) or
						sends (Push-Mode) an "Immediate" <code>SIF_Ack</code> telling the ZIS to discard the <code>SIF_Response</code> message.</p>
    <p>The agent has now completed processing of the <code>StudentSchoolEnrollment</code> event and opens a channel to the ZIS and sends a "Final" 
						<code>SIF_Ack</code> with the message identifier for the <code>StudentSchoolEnrollment</code> event. The <code>SIF_Ack</code> says that the agent has completed processing and the 
						ZIS removes the event from the agent queue.  The freeze on <code>SIF_Event</code> messages is lifted and the next message to be sent to the agent
						is the <code>SIF_Event</code> for a <code>StudentPersonal</code> Add:</p>
    <a name="TableF14AgentMessageQueueExample4" />
    <table title="Agent Message Queue - Example 4">
      <thead>
        <tr>
          <td>Agent Message Queue</td>
        </tr>
      </thead>
      <tr>
        <td>
          <code>SIF_Event</code> message containing a <code>StudentPersonal</code> object with an <code>Action</code> of <code>Add</code>.</td>
      </tr>
      <tr>
        <td>
          <code>SIF_Event</code> message containing a <code>StudentSchoolEnrollment</code> object with an <code>Action</code> of <code>Add</code>.</td>
      </tr>
    </table>
    <span class="caption">Table F.1-4: Agent Message Queue - Example 4</span>
    <h5>"Immediate" SIF_Ack</h5>
    <p>The "Immediate" <code>SIF_Ack</code>
is a <code>SIF_Ack</code> message with status code of <code>1</code>.  This type
of <code>SIF_Ack</code> is returned as a response to a message sent by the ZIS and indicates
that the agent has persisted or has processed the message and the ZIS must remove the message from its queue.</p>
    <a name="ExampleF11ImmediateSIF_Ack" />

    <div class="example_parent">
      <div class="example"
>&lt;SIF_Message Version="2.2" xmlns="http://www.sifinfo.org/infrastructure/2.x"&gt;
  &lt;SIF_Ack&gt;
    &lt;SIF_Header&gt;
      &lt;SIF_MsgId&gt;ABCD10580EF250789012AC0554321EA2&lt;/SIF_MsgId&gt;
      &lt;SIF_Timestamp&gt;2006-02-18T08:39:40-08:00&lt;/SIF_Timestamp&gt;
      &lt;SIF_SourceId&gt;RamseyLIB&lt;/SIF_SourceId&gt;
    &lt;/SIF_Header&gt;
    &lt;SIF_OriginalSourceId&gt;RamseySIS&lt;/SIF_OriginalSourceId&gt;
    &lt;SIF_OriginalMsgId&gt;10580EF2ABCD50789012AC05EA6C71B3&lt;/SIF_OriginalMsgId&gt;
    &lt;SIF_Status&gt;
      &lt;SIF_Code&gt;1&lt;/SIF_Code&gt;
    &lt;/SIF_Status&gt;
  &lt;/SIF_Ack&gt;
&lt;/SIF_Message&gt;
</div>
    </div>
    <span class="caption">Example F.1-1: "Immediate" SIF_Ack</span>
    <h5>"Intermediate" SIF_Ack</h5>
    <p>The "Intermediate" <code>SIF_Ack</code> is a <code>SIF_Ack</code> message with status code of <code>2</code>. 
This type of <code>SIF_Ack</code> is returned as a response to an event message delivered by the ZIS and indicates that the agent has not completed processing of the event and the ZIS must not remove the event message from its queue. 
The agent will send a "Final" <code>SIF_Ack</code> to the ZIS in the future to signal that the ZIS can discard the event message. 
An "Intermediate" <code>SIF_Ack</code> message must not be returned by agents in response to messages other than <code>SIF_Event</code>.</p>
    <a name="ExampleF12IntermediateSIF_Ack" />

    <div class="example_parent">
      <div class="example"
>&lt;SIF_Message Version="2.2" xmlns="http://www.sifinfo.org/infrastructure/2.x"&gt;
  &lt;SIF_Ack&gt;
    &lt;SIF_Header&gt;
      &lt;SIF_MsgId&gt;ABCD10580EF250789012AC0554321EA3&lt;/SIF_MsgId&gt;
      &lt;SIF_Timestamp&gt;2006-02-18T08:39:40-08:00&lt;/SIF_Timestamp&gt;
      &lt;SIF_SourceId&gt;RamseyLIB&lt;/SIF_SourceId&gt;
    &lt;/SIF_Header&gt;
    &lt;SIF_OriginalSourceId&gt;RamseySIS&lt;/SIF_OriginalSourceId&gt;
    &lt;SIF_OriginalMsgId&gt;10580EF2ABCD50789012AC05EA6C71B3&lt;/SIF_OriginalMsgId&gt;
    &lt;SIF_Status&gt;
      &lt;SIF_Code&gt;2&lt;/SIF_Code&gt;
    &lt;/SIF_Status&gt;
  &lt;/SIF_Ack&gt;
&lt;/SIF_Message&gt;
</div>
    </div>
    <span class="caption">Example F.1-2: "Intermediate" SIF_Ack</span>
    <h5>"Final" SIF_Ack</h5>
    <p>A "Final" <code>SIF_Ack</code> is a
message with status code of <code>3</code>. The agent sends this type of
<code>SIF_Ack</code> to the ZIS after the agent has completely processed a <code>SIF_Event</code> where
it previously sent an "Intermediate" <code>SIF_Ack</code>. When the ZIS
receives this message, it must discard the <code>SIF_Event</code> message referenced in the <code>SIF_Ack</code> upon successfully acknowledging the "Final" <code>SIF_Ack</code>.</p>
    <a name="ExampleF13FinalSIF_Ack" />

    <div class="example_parent">
      <div class="example"
>&lt;SIF_Message Version="2.2" xmlns="http://www.sifinfo.org/infrastructure/2.x"&gt;
  &lt;SIF_Ack&gt;
    &lt;SIF_Header&gt;
      &lt;SIF_MsgId&gt;ABCD10580EF250789012AC0554321EA4&lt;/SIF_MsgId&gt;
      &lt;SIF_Timestamp&gt;2006-02-18T08:39:40-08:00&lt;/SIF_Timestamp&gt;
      &lt;SIF_SourceId&gt;RamseyLIB&lt;/SIF_SourceId&gt;
    &lt;/SIF_Header&gt;
    &lt;SIF_OriginalSourceId&gt;RamseySIS&lt;/SIF_OriginalSourceId&gt;
    &lt;SIF_OriginalMsgId&gt;10580EF2ABCD50789012AC05EA6C71B3&lt;/SIF_OriginalMsgId&gt;
    &lt;SIF_Status&gt;
      &lt;SIF_Code&gt;3&lt;/SIF_Code&gt;
    &lt;/SIF_Status&gt;
  &lt;/SIF_Ack&gt;
&lt;/SIF_Message&gt;
</div>
    </div>
    <span class="caption">Example F.1-3: "Final" SIF_Ack</span>
    <div class="navigation" id="bottomnavigation">
      <hr />
      <a href="index.html">home</a>
      <a href="WildcardVersionSupportImplementationNotes.html">previous</a>
      <a href="BackgroundSupplementaryDocumentationNonNormative.html">next</a>
      <a href="index.html#contents">table of contents</a>
    </div><p align='center'><a href='http://validator.w3.org/check?uri=referer'><img src='http://www.w3.org/Icons/valid-xhtml10' alt='Valid XHTML 1.0 Transitional'/></a></p></body>
</html>